import request from '@/utils/request'

// 查询考试练习任务列表
export function listExams(query) {
  return request({
    url: '/Teacher/exams/list',
    method: 'get',
    params: query
  })
}

// 查询考试练习任务详细
export function getExams(examId) {
  return request({
    url: '/Teacher/exams/' + examId,
    method: 'get'
  })
}

// 新增考试练习任务
export function addExams(data) {
  return request({
    url: '/Teacher/exams',
    method: 'post',
    data: data
  })
}

export function checkLabIdExists(labId) {
  return request({
    url: '/Teacher/exams/labs/checkLabIdExists',
    method: 'get',
    params: { labId }
  })
}

export function checkSchoolIdExists(schoolsId) {
  return request({
    url: '/Teacher/exams/schools/checkSchoolIdExists',
    method: 'get',
    params: { schoolsId }
  })
}

// 修改考试练习任务
export function updateExams(data) {
  return request({
    url: '/Teacher/exams',
    method: 'put',
    data: data
  })
}

// 删除考试练习任务
export function delExams(examId) {
  return request({
    url: '/Teacher/exams/' + examId,
    method: 'delete'
  })
}
